package de.justphil.tcg.tcgserver.game.mechanics.game;

/**
 * @author Martin
 * 
 */
public interface OnGameProgressListener {
	
	public static int DRAW = -1;

	/**
	 * 
	 * @param winner
	 *            The number of the winning Player or -1 for a draw.
	 */
	void onGameOver(int winner);

	/**
	 * This method should be invoked each time the state of a slot changes.
	 * 
	 * @param player
	 *            The number of the owner of the progressed slot
	 * @param slot
	 *            The number of the progressed slot
	 * @param cardId
	 *            The id of the card in the slot or -1 for an empty slot
	 * @param propertyTypes
	 *            An array containing the types of each property the card has.
	 *            If a card has more than one property of the same type this
	 *            type occurs multiple times in the array.
	 * @param life
	 *            The recent life of the monster including manipulation through
	 *            properties
	 * @param attack
	 *            The recent attack of the monster including manipulation
	 *            through properties
	 * @param defense
	 *            The recent defense of the monster including manipulation
	 *            through properties
	 * @param agility
	 *            The recent agility of the monster including manipulation
	 *            through properties
	 */
	void onProgress(int player, int slot, long cardId, int[] propertyTypes,
			int life, int attack, int defense, int agility);

	/**
	 * This method provides the possibility to inform about certain events.
	 * 
	 * @param type
	 *            the type of the message
	 * @param text
	 *            the content of the message
	 */
	void onGameInfo(int type, String text);

	/**
	 * This method is invoked whenever a player is required to make a selection.
	 * 
	 * @param player
	 *            the number of the player
	 * @param slot
	 *            the slot of the monster which turn it is
	 */
	void onSelectionRequired(int player, int slot);

	/**
	 * This method is invoked whenever a player is required to confirm the
	 * recent game state before the game proceeds.
	 * 
	 * @param player
	 *            the number of the player or -1 for all;
	 */
	void onResumeRequired(int player);
}
